%% Temple university CIS 2033
% A modern Introduction to Probability and Statistics
% Chapter 12: The Poisson process
%
% Author: Djordje Gligorijevic
% email: gligorijevic@temple.edu
%
% Special thanks to Min Xiao (http://astro.temple.edu/~tud09663/index.html)
% for given examples and ideas for lab examples.

%% Excercise 1: 
% 1.1) Let X ~ Pois(2), compute p(k), k = 0, 1, 2, 50;
% 1.2) Let Y ~ Pois(1), compute F(k), k = 0, 1, 2, 50;

%% Excercise 2: load poiss.mat. 
% Let the discrete random variable X be the number of customers visiting
% ABC Bank in an hour. We know that X ~ Poiss(lambda). 
% The poiss.mat stores such information: 1000 records. 
% 2.1 Estimate lambda;
% 2.2 Compute P(X=k), k = minK, minK+1, minK+2, ..., maxK, where minK and maxK
% are the minimum and maximum of X, respectively;
% 2.3 Estimate P(X=k) by using the frequencies. 
% 2.4 Plot 2D figure with both results from 1.2 and 1.3: two curves;

%% Excercise 3: load norm.mat. 
% Let the continuous random variable X be the price changes of the product XYZ. 
% Positve values mean its price is increased and negative values mean its
% price is decreased. 
% We know that X ~ N(mu, sigma^2). 
% The norm.mat stores 1000 records of such information. 
% Please load the data and 
% 3.1) Estimate mu and sigma;
% 3.2) Compute P(X=a), a belongs to [minX, maxX] where minX and maxX are
% the minimum and maximum of X, respectively. 
% 3.3) Plot a 2D figure.
